All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.server.ConnectionEndpoint

java.lang.Object
   |
   +----sun.server.EndpointDescriptor
           |
           +----sun.server.ConnectionEndpoint

public class ConnectionEndpoint
extends EndpointDescriptor
ConnectionEndpoint is a connection descriptor that exposes all the configuration that a standard Java connection-based service can support. For now, that means it exposes TCP configuration.

NOTE: this does not currently capture all network config data; we're now setting timeouts, and they're not handled here.


Variable Index

 o backlogPropName
Key for value controlling connection setup backlog.
 o interfacePropName
Key for value controlling which network interface(s) are used
 o portPropName
Key for value controlling which port is used
 o props
Holds internal state of the endpoint descriptor.

Constructor Index

 o ConnectionEndpoint()

Method Index

 o getAdminAppletClass()
Endpoints can have custom administrative applets.
 o getCriticalKeys()
Lists the keys which initializeDescriptor absolutely requires to be made available to it.
 o getDefault(Object)
Returns the default value of a given defaultable key.
 o getDescriptorKeys()
Lists the keys understood by initializeDescriptor; these include ones which have default values, as well as ones which do not have default values.
 o getInterface()
Returns the address through which the service will be made available, or "*" if all available network addresses should be used.
 o getPort()
Returns the endpoint's port.
 o getServerSocket()
Returns a server socket satisfying the constraints of the descriptor.
 o getServerSocket(String, int, int)
Entry point which will usually be overridden by subclasses.
 o getValue(Object)
Returns the value of the specified object attribute.
 o initialize(Properties)
Initializes the endpoint.
 o setValue(Object, Object)
Assigns the value of the specified object attribute.

Variables

 o props
 protected Properties props
Holds internal state of the endpoint descriptor.

 o backlogPropName
 public static final String backlogPropName
Key for value controlling connection setup backlog.

 o interfacePropName
 public static final String interfacePropName
Key for value controlling which network interface(s) are used

 o portPropName
 public static final String portPropName
Key for value controlling which port is used

Constructors

 o ConnectionEndpoint
 public ConnectionEndpoint()

Methods

 o initialize
 protected void initialize(Properties props) throws ConfigurationException
Initializes the endpoint. The hashtable must hold a numeric value for the port. It may optionally hold a string value for the network interface to use (defaults to all interfaces), and a numeric value for the TCP backlog (defaults to fifty).

Note that even on hosts which are not multihomed, there will often be a difference between specifying "all interfaces" and between specifying the hosts's (only) name. That is because of the common use of fast "loopack" network interfaces.

Parameters:
props - set of properties from which to initialize the endpoint
Throws: ConfigurationException
if the endpoint was already initialized, or if one of the configuration properties was invalid
Overrides:
initialize in class EndpointDescriptor
 o getServerSocket
 public final ServerSocket getServerSocket() throws IOException, ConfigurationException
Returns a server socket satisfying the constraints of the descriptor. All connection based services support the standard socket model of service establishment, where a passive server thread waits for connections to be established to it by clients.

NOTE: This operation is specific to connection style endpoints. Datagram and other styles of endpoints will have their own methods for accessing network services.

Throws: IOException
if there's a network related problem
Throws: ConfigurationException
if the configuration information is problematic
 o getServerSocket
 protected ServerSocket getServerSocket(String ifname,
                                        int port,
                                        int backlog) throws IOException, ConfigurationException
Entry point which will usually be overridden by subclasses. This returns a socket, assuming that an interface name (which may be "*", indicating any interface may be used) and a port number are sufficient to identify it.

Parameters:
ifname - name of the interface on which to offer service, or "*" if the service is to be offered on all interfaces of a multihomed host
port - port number to use for this service.
backlog - how many network connections to queue up in the system infrastructure.
Throws: IOException
in case of address binding errors
Throws: ConfigurationException
if the configuration information is problematic
 o getValue
 public Object getValue(Object k)
Returns the value of the specified object attribute.

Overrides:
getValue in class EndpointDescriptor
 o setValue
 public void setValue(Object k,
                      Object value) throws IOException
Assigns the value of the specified object attribute.

Overrides:
setValue in class EndpointDescriptor
 o getPort
 public int getPort()
Returns the endpoint's port.

 o getInterface
 public String getInterface()
Returns the address through which the service will be made available, or "*" if all available network addresses should be used. Names for such addresses may also be returned, if supported by local network administration policies.

For example, when using NIS each address must have a single name. However, the Internet's DNS recognizes that all of a host's addresses should normally be treated the same, mapping to the same canonical host name. Only when a mulithomed host is being used for "virtual hosting" will DNS assign different names to each of a host's network addresses.

 o getCriticalKeys
 public Vector getCriticalKeys()
Lists the keys which initializeDescriptor absolutely requires to be made available to it. All other keys have default values. Note that subclasses may provide defaults for values that superclasses require.

Overrides:
getCriticalKeys in class EndpointDescriptor
 o getDescriptorKeys
 public Vector getDescriptorKeys()
Lists the keys understood by initializeDescriptor; these include ones which have default values, as well as ones which do not have default values.

Overrides:
getDescriptorKeys in class EndpointDescriptor
 o getDefault
 public Object getDefault(Object key)
Returns the default value of a given defaultable key.

Parameters:
key - identifies which default value is requested
Overrides:
getDefault in class EndpointDescriptor
 o getAdminAppletClass
 public String getAdminAppletClass()
Endpoints can have custom administrative applets. This returns the name of an applet class that understands how to administer the properties of this particular kind of endpoint.

Overrides:
getAdminAppletClass in class EndpointDescriptor

All Packages  Class Hierarchy  This Package  Previous  Next  Index